<?php
require_once APPPATH . 'models/Blog.php';

class blogcontroller extends CI_Controller{
	//Doctrine EntityManager
    public $em;
	function __construct() {
		parent::__construct();
		
		//Not required if you autoload the library
        $this->load->library('doctrine');
 
        //Instantiate a Doctrine Entity Manager
        $this->em = $this->doctrine->em;
	}
	public function index()
	{
		$blog = $this->em->find('Blog', 1);
		echo $blog->content;
		
		$user = new models\User;
		$user->setUsername('Joseph');
		$user->setPassword('secretPassw0rd');
		$user->setEmail('josephatwildlyinaccuratedotcom');
		
		$this->em->persist($user);
		$this->em->flush();
	}
}